﻿using Microsoft.AspNetCore.Mvc;

using SqlSugar;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using VM.Entity.EntityMap.Files;
using static Dm.net.buffer.ByteArrayBuffer;
using System.ComponentModel.DataAnnotations;
using System.Xml.Serialization;

namespace VM.Entity.EntityMap.Title
{
    /// <summary>
    /// 文章
    /// </summary>
    [SugarTable("sys_title")]
    public class sys_titleParent
    {
      

        #region Model
        private int? _id;
        private int? _createuserid;
        private DateTime _createdate;
        private int? _updateuserid;
        private DateTime _updatedate;
        private string _description;
        private int? _iscryptonym;
        /// <summary>
        /// 内码
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsOnlyIgnoreInsert = true)]
        [JsonIgnore]
        public int? id
        {
            set { _id = value; }
            get { return _id; }
        }

        /// <summary>
        /// 单据状态 1 草稿  2发布
        /// </summary>
        public int businessStatus { get; set; }
         
        /// <summary>
        /// 创建人
        /// </summary>
        [JsonIgnore]
        public int? createUserId
        {
            set { _createuserid = value; }
            get { return _createuserid; }
        }
         
        /// <summary>
        /// 创建时间
        /// </summary>
        [JsonIgnore]
        public DateTime createDate
        {
            set { _createdate = value; }
            get { return _createdate; }
        }
        /// <summary>
        /// 更新人
        /// </summary>
        [JsonIgnore]
        public int? UpdateUserId
        {
            set { _updateuserid = value; }
            get { return _updateuserid; }
        }
         
        /// <summary>
        /// 更新时间
        /// </summary>
        [JsonIgnore]
        public DateTime UpdateDate
        {
            set { _updatedate = value; }
            get { return _updatedate; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Description
        {
            set { _description = value; }
            get { return _description; }
        }
        /// <summary>
        /// 是否匿名  1是  0 否  
        /// </summary>
        public int? isCryptonym
        {
            set { _iscryptonym = value; }
            get { return _iscryptonym; }
        }

        /// <summary>
        /// 类型，1 报好价，2发笔记， 3 发文章
        /// </summary>
        public int typeId { get; set; }

        /// <summary>
        /// 主要信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(id), nameof(sys_titleMainInfo.parentId))]
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        public sys_titleMainInfo main { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [Navigate(NavigateType.OneToMany, nameof(sys_fileLog.parentId), nameof(id))]
        public List<sys_fileLog>? files { get; set; }

        /// <summary>
        /// 话题
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true)]
        [Navigate(NavigateType.OneToMany, nameof(sys_titleTopic.parentId))] 
        public List<sys_titleTopic>? topic { get; set; }





        #endregion Model

    }
}
